<template>
	<view>
		<view class="example">
			<picker mode="date" v-model="searchValue" start="" end="" @change="pickerChange">
				<uni-easyinput prefixIcon="search" v-model="searchValue" placeholder="请选择查询日期" disabled @iconClick="iconClick"
				 :styles="styles"></uni-easyinput>
			</picker>
			<view class="screen">
				筛选
			</view>
		</view>
		<view class="footer">
			<text>合计金额：</text><text style="color: #00cc62;">0</text><text style="padding-left: 10rpx;">元</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchValue: '',
				styles: {
					disableColor: '#fff',
					borderColor: '#8d8d8d'
				}
			}
		},
		onNavigationBarButtonTap(e) { //监听顶部按钮点击
			uni.navigateTo({
				url: 'addSalesRec',
				success: res => {
					console.log("success");
				},
				fail: () => {
					console.log("fail");
				},
				complete: () => {}
			});
		},
		methods: {
			iconClick(type) {
				uni.showToast({
					title: `点击了${type==='prefix'?'左侧':'右侧'}的图标`,
					icon: 'none'
				})
			},
			pickerChange: function(e) {
				this.searchValue = e.detail.value
			},
		}
	}
</script>

<style>
	.example {
		display: flex;
		align-items: center;
		width: 100%;
		padding: 20rpx;
		background-color: #fff;
	}

	.example picker {
		flex: 1;
	}

	.screen {
		width: 120rpx;
		line-height: 36px;
		font-size: 36rpx;
		color: #7a7a7a;
		text-align: center;
	}

	.footer {
		position: fixed;
		bottom: 0;
		background-color: #fff;
		text-align: right;
		padding: 0 5%;
		width: 100%;
		line-height: 120rpx;
	}
</style>
